
package com.insigma.business.qrcode.common.service.impl;


import com.insigma.business.qrcode.common.dao.CommonRepresentationRecordDao;
import com.insigma.business.qrcode.common.dto.CommonRepresentationRecordBSearcher;
import com.insigma.business.qrcode.common.dto.CommonRepresentationRecordDO;
import com.insigma.business.qrcode.common.service.CommonRepresentationRecordService;
import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("commonRepresentationRecordService")
public class CommonRepresentationRecordServiceImpl implements CommonRepresentationRecordService {

    @Autowired(required = false)
    private CommonRepresentationRecordDao commonRepresentationRecordDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<CommonRepresentationRecordDO> search(final CommonRepresentationRecordBSearcher commonRepresentationRecordBSearcher) {
        return commonRepresentationRecordDao.search(commonRepresentationRecordBSearcher);
    }
   
    @Override
    public CommonRepresentationRecordDO get(final String id){
        return commonRepresentationRecordDao.get(id);
    }

    
    @Override
    public Integer insert(final CommonRepresentationRecordDO commonRepresentationRecordDO){
        commonRepresentationRecordDO.setId(sequenceGenerator.genKey(SequenceNameConstant.COMMON_REPRESENTATION_RECORD_ID));
        return commonRepresentationRecordDao.insert(commonRepresentationRecordDO);
    }

    
    @Override
    public Integer update(final CommonRepresentationRecordDO commonRepresentationRecordDO){
        return commonRepresentationRecordDao.update(commonRepresentationRecordDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return commonRepresentationRecordDao.delete(id,modifierType,modifierId);
    }

    @Override
    public List<CommonRepresentationRecordDO> listByIdCardNoAndType(String idCardNo, String type) {
        return commonRepresentationRecordDao.listByIdCardNoAndType(idCardNo,type);
    }

}
